<?php
class Personal extends CI_Controller
{
	public function __construct()
	{
		parent::__construct();
		$this->load->model('user_model');
		$this->load->model('word_model');
		$this->load->library('session');
		$this->load->helper('url');
	}
	public function index()
	{
		$data = array();
		if(isset($_SESSION['user']))
		{
			$data['user'] = $_SESSION['user'];
			$data['flag'] = 1;
			$_SESSION['id'] = $this->user_model->getID(array("user"=>$_SESSION["user"]));
			$data['userInfo'] = $this->user_model->getInfo($_SESSION['id']);
			$data['count'] = $this->word_model->getCountToday($_SESSION['id']);
			$data['tableInfo'] = $this->word_model->getTableInfo($_SESSION['id']);
			echo json_encode($data);exit;
		}
		else
		{
			$data['flag'] = 0;
			echo json_encode($data);exit;
		}
		//$this->load->view('user/user',$data);
	}
}